If you consider Pokemon Showdown! as an accurate source of information for these things, then switching happens before the Terastallization. This replay is proof. I also used some priority moves in this battle. I used Helping Hand in this one.
Pokemon Showdown! isn't always correct, but it's tested against the base mechanics very thoroughly (and it's been like a year).
According to Bulbapedia, game mechanics as considered 'special priority' rather than the system that moves use. Specifically;
The messages for the activation of Quick Claw, Custap Berry, and
O-Powers are always shown before anything else. Switching out,
rotating, using items, escaping, and the charging messages for Focus
Punch, Beak Blast, and Shell Trap are displayed or performed next.....
Mega Evolution and Dynamaxing generally occur at the beginning of a
turn but after any switching has occurred; however, if a Pokémon is
Mega Evolving or rotating in and then using Pursuit on a Pokémon that
is switching out, the Mega Evolution or rotation always happens before
the Pokémon uses Pursuit (and therefore before the other Pokémon's
switch).
The article.
This makes the whole 'priority' thing very difficult to figure out. According to the Bulbapedia article, switching actually goes after a few rare actions. Since Tera happens before Helping Hand, it's at least +6. It happens after switching, which would be +7, and the few rare actions would be +8. In previous generations, this priority changes if you use Pursuit while Mega-Evolving or Dynamaxing.
So the answer is most likely that Terastallization would be a +6, since it goes before switching and after Helping Hand.