I think part of what's happened is that "identity" used to more or less match reality, and if it didn't, it was recognised that something was amiss. People knew what sex they were (as they do know, pretty much everyone knows) and to claim to be the opposite sex generally had to mean that the person was either delusional/insane, or pretending, e.g. in disguise. A man's self-image/"identity" as a good, upstanding man would generally involve not going into women's spaces - whether because he cared about not upsetting women, or because he didn't want the stigma of being seen to be a dodgy perv or predator (even if he would be if he could get away with it).
What we have since trans became a thing - initially in the 20th century, then on steroids in the last decade - is this idea that a man can BE a woman in some sense. (and vice versa of course, but the reverse situation doesn't carry the same risks - except, of course, to the females involved, TM themselves). That "identity" can be the opposite of reality. That's what trans is - it's not your identity as a gay person, or a particular ethnicity, or your class or whatever, based on the real facts about you. It is by definition identifying as something you're not and cannot be, and then trying to change definitions of words to make that a "reality".
Once you do that and it takes hold, then it is really hard to "police" and to ask the question "are you really female" of everyone who approaches a female-only space. It never worked like that before. It worked because of a general agreement that going in the opposite sex's space wasn't something you'd want to do, because only someone very questionable or odd would do that.
Just as now, we have a big stigma about people who "identify" as a race they are not and basically treat them with derision. They may exist, but the reason there aren't loads of them is because it's not a concept that has become accepted and put into law and pushed at kids and rewarded with being treated as a sacred caste. if it was, it would attract all sorts of people overnight for a variety of reasons (attention-seeking, gaining opportunities, seeking a solution to MH problems, wanting to be seen as cool, etc etc), just as "trans" does now.
It would also be hard to police "is that person really black" or "is that person really under 18" or "is that person really disabled" if there was a huge explosion of people "identifying" as what they are not in these categories and it being seen as some kind of right that everyone had to agree with their "identity" instead of the reality. It's not always easy to police those things now - and yet we do - with a combination of laws, registration systems and social expectation/stigma.