No, there's no law that says it's a criminal offence to be in a woman's toilet. There just isn't. Anyone can be asked to leave. You can be thrown out of a pub for using the men's. It doesn't mean you've committed a crime or that the men in the toilet could have you prosecuted
Petrol, why do you persist in ignoring the difference between UK Criminal law and UK Civil Law?
UK Civil Law is clear, no male should ever be in any spaces or service, sport or advancement scheme etc that is designated for females.
If such a breach of this position occurs the legal liability lies with the provider of such services.
So it is for the managers of facilities designated for females to ensure that no males, regardless of how they choose to present themselves, cannot and should not access the facilities they have designated for females.
In the case of any interactions between females and males in such facilities, the most likely Criminal Law that could apply is the Sexual Offences Act 2003. if an incidence of voyeurism, indecent exposure, sexual assault or rape occurs.