It's scuzzy and illegal to spy on neighboring stalls. It is not illegal to pee. Both regardless of the sign on the door.
Now, I should note that you don't have to be doing anything wrong to be told to leave. Property owners or tenants generally have authority to establish whatever rules they want for any or no reason - but the maximum punishment is being removed from the property. Using that authority to discriminate against TG people
is allowed unless they are specifically protected by anti-discrimination laws.
Everyone is welcome to call the police, but the worst-case
legal scenario is they escort you out and you're not allowed to come back.
Assuming nobody is bending the law, that is. So let's look at what laws would be involved.
Under common-law tradition, nobody is supposed to "
intrude upon seclusion" - attempt to gather private information when an ordinary "reasonable person" would expect it to be private and would be offended by the intrusion. This is a tort, not a crime, which means the person whose privacy was violated may claim monetary reparation.
Additionally, many states make violation of privacy in private places a misdemeanor - Maine comes to my mind:
hiding cameras in bathrooms earns you jail time.
Again, the crime would be violating privacy - observing things a stranger is not supposed to observe - the laws are not intended to enforce gender roles.
And, finally, there's still the risk of verbal and physical violence used to enforce social norms. This
is illegal, potentially a felony, and the law's on your side for whatever that's worth.
I think the best thing to do for your safety is to search out local TG advocates and hear what the experiences are in your area as far as violence and mis-applied laws.