Casters can’t switch who the spell will hit once they’ve begun casting. Many tank swaps happen during a cast bar. That’s your clue to provoke (you don’t have to swap before the cast). For example, in o2s, you can provoke during Evilsphere. It will hit the original tank, then the boss will swap to you. In o4s, you can provoke during Thunder III. The first will still hit the original tank, then it will swap to you for the second hit (you should be immunitying this and taking both hits, but this is just for example).

When you’re starting to learn, stay in tank stance until you get the hang of when it’s safe to swap into dps stance. Don’t be one of those “dps first” tanks. None of the raids this tier require execessive tank dps to clear.