First they scent out a ripened personal space. Usually they can tell by your actions. Are you doing something anti-social? Reading? Earphones in? Both is best. Do you look like you're too polite to send them on their way? Even better. They have now identified their prey.
You'll know you've been spotted by the presence of uncomfortable, unblinking eye contact.
Sidle. Sidle sidle. It has breached your outer personal space. They will often try, at this point, to look pathetic to lower your defences.
They are intensely intent on their goal. You might try an unfriendly posture or facial expression. Greater people than you have tried this and failed. It won't help to take out your phone at this point. They don't care if you're texting someone.
Be crazier. Beat them to the punch.