This depends on where the game was purchased:
- Steam players are not required to have an Xbox account or sign into an Xbox account in-game.
- Microsoft Store players will already have the Xbox account used to purchase the game.
Some Age of Empires games have an option to retain event rewards by signing into an Xbox account. In those cases, it's easy (and free!) to set up an account.
Create an Xbox account