The shadow communities secretary praised Rowling’s stance on sex-based rights