1: Check the variable list on the console. Look for things like SugarCube.State.variables.mcname
or SugarCube.State.variables.player.name
2: If you can't find it, you can take a look at the HTML file and search for text where it's mentioned.
eg; if there's a paragraph that says "You are John Doe, a retired detective", you can search for "a retired detective" on the HTML file and see what variable stores the name.
If you still can't find it, you can upload the HTML file (or tell me the game's name, I may have it downloaded) and I'll take a look.