When meetings include live captions or transcription, Teams automatically identifies the speaker along with what they say. You can choose to hide your name in live captions, live transcription, and the saved transcription that's available after the meeting.
Do this before the meeting where you want to speak anonymously.
Select More options next to your profile picture at the top of Teams and then select Settings.
Select Captions and transcripts on the left and then select the Automatically identify me in meeting captions and transcripts toggle to turn off the option.