
When I started university (prior to legal name change) I spoke to the people at the registrars office about it, and they changed my name on my student ID and canvas, so professors automatically knew me as such. If they are professors you already know though, asking them privately would be best imo
if you know where it will be published, you can check their guidelines (if it will help u have that conversation). it’s not uncommon for people to publish under a name that’s different from their legal names, esp to keep publication credits consistent. many people opt to continue publishing under their maiden name, for example.