The settlement marks a significant victory for the Trump administration in its escalating attacks on transgender rights.