Simple solution is to change the password on your account. Then the hacker will be stymied. He cannot do this (assuming you have 2x authentication in place), only you can change the password. Otherwise, it's a factory reset and input another account, but a password change would be better. This time, set the password to something less easily guessed.
Note that if you swap accounts for a new one you'll lose all your apps as they are glued to your Xbox account which is glued to your MS account. The only way around this is to get MS to detach your Xbox account from your old MS account by talking to Support. This can be a challenge to get done, but I have done this before now to drop a broken MS account so it is possible. Your apps and other purchases follow the Xbox account, not the MS account.