A single sensor can be used that measures the position of one moving magnet, and the position of the other magnets can be inferred.
Sensors can be placed on each moving magnet to provide a more accurate measurement of each magnet location.