I traded it over the GTS on Pokémon Home. In home it shows the Shield Icon.
That means that the last game it was in was Shield. It was caught in Sword, moved to Shield, and then moved to Home.