The directive, which continues the Trump administration’s efforts to curb transgender rights, could end school-based mental health services and support for homeless students.