We did some research work on model-to-model translations (in the end, it's basically the same problem) and we ended up with mixed feelings (as we explain in the article: https://modeling-languages.com/lstm-neural-network-model-tra... ).
Mostly, right now (IMHO) you can only get some success translating very short pieces of code.
We used LSTMs for that (which seems to be the more usual approach in this domain)