It took me a while to notice it, surprisingly. The distinctive armor is a give away, but there's also a book that you can find in the one of the vault's in the Counting House called the "Astral Prism Heist." It is listed as Gortash's private memoir notes. Within, it talks about how Gortash found out about the astral prism, and--to quote--it goes on to say:

Quote
"Thus was born the plan to send a tadpoled strike team in a regrown nautiloid piloted by the Emperor to steal the Astral Prism from Vlaakith."

Somehow this plan must have converged with Shadowheart's strike team. Once Shadowheart was on board the nautiloid with the astral prism, the Emperor must have been freed from the Elder Brain's control.

I suspect that the dead mind flayer seen in the opening scene was killed by the Emperor when he was freed. And that the Emperor was the one who tadpoled us, probably in an effort to create a weapon he planned to use against the Absolute plot.