I think it's in the approach, to be honest.
A man should be able to tell a woman he finds her attractive without it being labelled as sexual harassment.
It's if he continues pursuit after her declines and rejections then it becomes sexual harassment.
Men need to be able to state their attraction verbally, even if it goes nowhere or gets them rejected.
It's a psychological factor. Plus I honestly don't think there's been a woman on this planet who doesn't know what having a crush on someone and not being able to tell them about it feels like. --That's a pretty universally understood psychological factor.
History has also showed us repeatedly what happens with repression:
Alcohol Prohibition in the United States resulted in bootlegging, and sexual repression within the history of Catholicism has lead to a number of sexual harassment cases.
The more you try to make something not happen, the more likely you are to make it happen.
I don't think it's sexual harassment for you to just state your attraction.
I think it's sexual harassment if you overstate your attraction and/or make it seemingly, forcibly uncomfortable for her to reject you.
I can tell a woman at the roll of my wrist if I think she's attractive.
An attraction is an observation, that's all that it is:
You observed either physical or psychological aspects of a person that you find attractive.
What's actually important is that you keep your feet planted firmly on the ground while your head is aloft floating in the clouds all spun out on dopamine, serotonin, and hormones.
Also, remember: Love Blinders are a real thing, when you're attracted to somebody, you're not thinking logically and clearly, you're emotionally compromised. So if that person happens to also be a bad person despite the fact that you find them attractive, you'll need to train yourself to detect that ahead of time. You see this all the time in movies: Girl is into a guy, said guy is shady, her friend says she thinks something's up with him and he's dangerous, girl in disbelief accuses her best friend of being jealous, only to find out later that her friend was right and said guy is like a serial killer. --There's a reason that's a movie trope, that's what Love Blinders do to the human brain: If you care about someone enough, you'll overlook them while they're simultaneously taking advantage of you, and yes that can go both ways and come from both genders.