Being an ally
Hang about near the wash-basins in case they get harassed by a bigot when they are in there, so you can tell the bigot to leave them alone.
Wear an “I’ll go with you” badge in solidarity so they know you are not going to harass them.
React to their presence exactly as you would to any other person in a public bathroom. In Britain, this usually means minimum conversation.
Not harassing them
Don't ask about whether they've had the operation. How would you feel if a total stranger asked about the configuration of your intimate parts?
Don't say they look really "convincing". It's not helpful.
The usual guidelines of how to interact with strangers apply here.
"What To Do If a Trans Person Enters the Bathroom" by Joey Alison Sayers