The Education Department on Wednesday issued guidance that Title IX prohibits discrimination based on sexual orientation and gender identity, a reversal of the Trump administration’s stance that gay and transgender students are not protected by the law.