I am going to be using a serebii article. I count mythical Pokemon as legendaries, so I'll be counting them too. If you don't want mythics, I'll edit em out. I am doing this as of gen 8 and 7, so even if you can't transfer the Pokemon in to sword and shield, if you got it legit in USUM, it's fair game.
Can be Obtained Legitimately:
Ash-hat Pikachus (event only)
Articuno (base)
Zapdos (base)
Moltres (base)
Mewtwo
Mew (Apparently it can be Obtained Legitimately according to serebii, didn't know that)
Celebi
Lugia
Ho-Oh
Raikou
Entei
Suicune
Regirock
Regice
Registeel
Latios
Latias
Kyogre
Groudon
Rayquaza
Jirachi (Apparently you can, didn't know)
Deoxys (Apparently you can, didn't know)
(Arceus isn't on the article, but you couldn't obtain it legit unless you were like playing in like 2009, and you could get it for one week, so chances are, it isn't shiny)
Uxie
Azelf
Mesprit
Dialga
Palkia
Heatran
Regigigas
Giratina
Cresselia
Phione
Manaphy
Darkrai
Shaymin
Cobalion
Virizion
Tornadus
Thundurus
Landorus
Reshiram
Zekrom
Kyurem
Keldeo
Vivilion Pokeball and Fancy (Event Only)
Xerneas
Yveltal
Zygarde
Diancie
Hoopa (event only)
Volcanion (event only)
Type: Null
Silvally
Tapu Koko
Tapu Fini
Tapu Bulu
Tapu Lele
Solgaleo
Lunala
Niheligo
Buzzwole
Pheromosa
Xurkitree
Celesteela
Kartana
Guzzlord
Necrozma
Magearna (event only)
Marshadow
Poipole
Naganadel
Stakataka
Blacephelon
Zeraora
Meltan
Melmetal
Zarude (event only)
Regieleki
Regidrago
So based off of this, the non obtainable are:
Articuno (galar)
Zapdos (galar)
Moltres (galar)
Keldeo
Cosmog
Cosmoem
Zacian
Zamazenta
Eternatus
Kubfu
Urshifu
Glastrier
Spectrier
Calyrex
Here's my source:
Source (tried to find serebii so you could look at it too lol)
Hope I helped!