There's nothing wrong with noticing that someone else out and about in public is trans* but it is rude to stare even if there is nothing bad intended by it.
Over the years I've noticed quite a few transwomen and some transmen - sometimes they are a bit obvious, other times hardly at all. If I do notice someone on a train I try to be very discreet - it can be a bit hard to avoid eye contact but it's also easier for someone to know they are being looked at. I'm always curious to see what what works for them, what maybe doesn't work; but my main interest is usually whether or not other people have noticed them. With the exception once of a woman who was dressed in extremely short glitter shorts and who was clearly off her brain on some psychotropic substance (laughing and muttering to herself) no other trans* person I've noticed in public has, as far as I've observed, drawn attention from anyone else (and even then, I don't think that woman was drawing attention for being trans*, just for acting really weird. And those shorts).
It's good you've realised that staring wasn't very appropriate. Yeah, you'll notice people but please be discrete, I'm sure you'd appreciate other people did the same for you when you go out in girl mode. 🙂