South Dakota must pay transgender activists, court says