Microsoft has been really pushing online accounts to log in to a Windows installation, both when you are setting up a new machine and while you are using it, with endless notifications. While avoiding it during initial setup is easy (don't connect to any network until you have created your local account), stopping the latter is not easy.
Luckily, we can use Group Policies to solve it.
You can find "Edit group policy" by searching in the start menu, or by executing GPEdit.msc from the run menu.
You probably also want to change this settings to be able to install Microsoft Store apps without an account