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.
- Find Computer Configuration->Windows Settings->Security Settings->Local Policies->Security options
- Locate the policy "Accounts: Block Microsoft Accounts"
- Change the value to "Users can't add Microsoft accounts"
You probably also want to change this settings to be able to install Microsoft Store apps without an account
- Computer Configuration->Administrative Templates->Windows Components->App runtime
- Locate the setting "Allow Microsoft accounts to be optional"
- Change the value to "Enabled". This will allow apps which support it to be installed without a Microsoft account attached