Isn’t that what we’ve been doing for centuries?The even better solution is to make sports based on sex and not gender.
A biological man is free to say he identifies (gender wise) as a woman. But he/she still has to compete with others born the same sex