That’s one of the identifying factors for a trainer according the network. OT name, OT gender, TID, SID, assigned ‘game sync ID’.
I’m not super sure, but I believe the following factors are not actively monitored but important as well (based on my experience in Gen 7): version of game the save was created on, save game language.
Those shouldn’t be changed. I think that’s all I could think of at the moment.