Yes, you can – but you'll have to follow a new set of rules. Britain is now treated as a “third country” when it comes to moving to somewhere in the EU, which means that the process is a little more complicated than before. If you were a legal resident in Spain before 1 January 2021, you will be able to stay.