While it's taking elements of the mainline games over to itself (the battle system, primarily) it is definitely structured more as a spin off.
I mean, again, they're releasing it like 2 months after BDSP. They clearly think these two titles aoccupy different niches; which, well...they do
The official website calls Legends as part of the core series so it's mainline on that notion in and of itself.
It's probably like Let's Go Pikachu and Eevee in that it's a mainline game, but also does its own thing at the same time and could very well be the beginning of a sub series within the core series. It also shares continuity with mainline canon being a prequel to DP which makes it a mainline game, plus it follows many of the traditional mainline elements. It's being called the "evolution of the franchise" which means it's clearly a core series title.