The truly hard part (male POV) is when a boy/man sees a person that they like the looks of, and they lack the confidence or are an introvert and stare and look (oggling view). When is the redline passed?
If a person is shopping, using public transport, eating a meal at a bar, that is the reason they are there. They aren't date hunting etc ...
The only advice I can think of with this regard is something like a 30 second rule. If during the commute, or stay in a location you find yourself gazing for more than 30 seconds, you need to human up and introduce yourself or realize what was a "green" accepted practice is now "yellow".
I never understood this (my wife said I stared at her and was creepy when I was younger), but then she realized I was a good guy and well she did marry me :). I had confidence issues :) so much better when I was in a gay bar in San Francisco with a friend.
I had men cat call me, stare and even a crossdressor grab my genitals and state, you know stick with me and us and we will make you realize women aren't the best at sex.
Eye opening experience in a big way.
Now I guess I was lucky to be deemed attractive (yeah me), and when I am an extrovert, but the flip view was shocking but humbling.