Iirc, ERAS automatically imports your legal name from your AAMC account (which specifically requires legal name). That name also has to match what's in your USMLE records in order to import your test scores.
edit: not sure whether you're thinking about changing your name, but one piece to consider is that although it may be too late for ERAS, if you really don't want your current legal name to be out there and associated with you professionally, it is preferable to change it sooner rather than later. Once you have a medical license, NPI number, etc. under a certain name, that information is publicly available and remains easy for people to find once you've changed your name.
I always tried to look and see what a person's preferred name was on their application; because that is what we would call you on interview day. So, if your legal name was Robert William, but your preferred name is Regina, (actually has happened) then Regina is what will go on the name badge, on the schedules, etc. for the interview day. Not all programs do this; but most do.