Use the same skills you do to predict that a motorist will suddenly change lanes. Look for head movement, or even body movements which could indicate they are about to swerve left or right from their lane.
Just as we expect courtesy from other motorists, we should also extend it to our fellow riders and allow them file in front of us.
At the lights, if we filter to the front, consider moving to the side if there is room.
This will allow a following lane-filtering rider to queue up beside you.