Compilers transform source code in one language to another target language.
Transformer models can transform natural language to another target language.
That’s the commonality. What’s the distinction you want to make?