This is so unhelpful to trans people who just want to go about their lives unnoticed.
What it is highlighting is that for some people, being trans isn't about wanting to be accepted and treated more or less as though they were a member of the opposite sex, but there is a fetish aspect to it. And also that in many workplaces, if you are trans, the rules and standards of behaviour that apply to everyone else don't apply to you.
All that is necessary here is for this person's line manager to take them to one side, and without even mentioning the word "trans", say, "The clothes you are wearing are against the staff dress code. Please wear more appropriate clothes to work from now on."