Personally I think any sport which has rankings / championships should be separated by biological sex rather than gender.
Allow anyone to join "XY" teams but only allow female-at-birth to join "XX" teams. Unless it's a just-for-fun league then anyone can join.
It does get complicated though with intersex and whatnot, but unfortunately life isn't fair and some people draw the short straw. They can join the "XY" leagues if they are good enough.