President Trump’s executive order banning transgender people from enlisting and serving in the military could endanger the jobs of thousands of active-duty service members.