Let $A \subseteq M$ and let $R \subseteq M^I$ be $A$-invariant.
If $M$ is $\kappa^+$-strongly homogenous for $\kappa = |A| + |I|$, then $R$ is $A$-definable in $M$ in the infinitary logic $\mathcal{L}_{\lambda, \omega}$ where $\lambda = (\kappa + |T|)^+$.
$R$ is $A$-definable in $M$ in the infinitary logic $\mathcal{L}_{\lambda, \omega}$ where $\kappa = |M|^+$ and $\lambda = (|T| + |M| + |I|)^+$
So, my idea is the next one: As $M$ is $\kappa^+$ strongly homogeneous every mapping can be extended to an automorphism. Take this extension for every mapping, and as $R$ is invariant, then $a \in R$ then $f(a) \in R$. We know that $R$ is definable if for some formula $\varphi(x)\in A$, for every $a \in M$ $M \models \varphi(a) iff a\in R$. I know that somehow I need to find a formula using $f(a)$ to plug in there, but I am not sure what formula I can use. I know it needs to look something like "there is a tuple such that $M \models$ exactly $f(a)$".
I still can see that I am not using completely correctly the sizes, but I am at lost at how to do this. I would very much appreciate any help cleaning up this sketch and ideas on how to fill in the details that I am clearly missing. Thank you for your help.