The directive built on a string of recent actions to roll back federal protections and services for transgender people.