In an executive order, the president also moved to end gender-related medical treatments for transgender people in prison.