It occurs to me that some seem to be looking for a type of universal rule or law that can be applied to every individual in every circumstance. I don't think that's practical.
The thing about sports is that a separate classification was created primarily to address a specific issue: the differences in performance between males as a population and females as a population. Pointing to individuals within either population does not advance a point.
So the starting line for qualifying for each group is based upon the definition of that population: is this person male or female?
Now there is a relatively small group of people for whom the answer to that question is not immediately obvious. I'm not going to use the term "population" for this group because it's a diverse enough group that I don't think they can be treated as a uniform population. This group includes people with DSDs and people who are transitioning. My position is that in these situations decisions need to be made at an individual case by case level.
At that level of detail, while I'm not opposed to guidelines, I don't like rules or laws. There are times when what is called for is discretion or judgement. I think this is one of those cases. A biological male who identifies as a woman can make the case to a sports league that they can fairly compete in the female division. The league can then make a decision considering whatever supporting information the applicant chooses to provide based on the individual and the particular sport. The same goes in the other direction, though approval would likely be easier in most cases due to the lack in competitive advantage. One issue of said approval in that case would also be exemption from rules banning the use of certain hormones which are otherwise considered PEDs.
I realize that this means that a biological female's sex could be challenged, but that is already the case. It's nothing new. If you have leagues with eligibility criteria, an athlete's eligibility is and has always been open to challenge based on that criteria, be it age, weight class, PED use, grades, or sex. It's nothing new and not the "gotcha" some people seem to think it is.