Generally, use the name a person chooses to be identified by: Chelsea Manning, Caitlyn Jenner, Madonna, Muhammad Ali
Identification of prominent figures should consider an international audience:
U.S. Secretary of State John Kerry
U.K. Chancellor George Osborne
Barack Obama said (first mention) … the president recalled (second mention)