Serebii.net states that for Z status moves:
"These effects mostly just boost stats for the duration of the battle and do count as your one Z Move so choose wisely if you wish to have the added boost."
Does "for the duration of the battle" work like any other stat boost, because the phrasing implies that it works even if the pokemon is switched out and sent out again.