The Terms of Service:
https://twitter.com/content/twitter-com/legal/en/tos
states “You may use the Services only in compliance with these Terms and all applicable laws, rules and regulations”, and links to the Twitter Rules and Policies:
https://help.twitter.com/en/rules-and-policies
Following the link to the “Hateful Conduct Policy”:
https://help.twitter.com/en/rules-and-policies/hateful-condu...
Which states:
> We prohibit targeting others with repeated slurs, tropes or other content that intends to dehumanize, degrade or reinforce negative or harmful stereotypes about a protected category. This includes targeted misgendering or deadnaming of transgender individuals.
In the Wayback machine, it looks like that direct language was added in an update between October 19 and October 28 of 2018, about four years ago:
https://web.archive.org/web/20181028023901/https://help.twit...
The older version had this, which reasonably encompasses that behavior, though doesn’t name it specifically:
> repeated and/or or non-consensual slurs, epithets, racist and sexist tropes, or other content that degrades someone.