The only way to enforce this would be to have new IDs issued to everyone with a bar code that includes sex at birth and a pin number. This would require scanners at the entrance to every bathroom to make sure you are of the right sex before the door opens.
Sigh.
I really think the intent is to make trans men vulnerable in the mens room to homophobic predators.