The policy aligns with an executive order President Donald Trump signed in January to bar transgender individuals from serving in the military.