There was a question like this in 2019. I hope things have changed since then.
Concretely, I am looking for a way to train a transformer model to convert code from SAS to Python. I guess the method does not depend on the pair of programming languages requested as long as one has enough data for training.
There are paid tools, e.g. CodeConert and sas2py, that do this, but I can not find out what the are based on and how they were built.
It appears that one (very bad) way could be to use interpreters that translate one programming language, e.g. Java, to English and then from English to the second programming language, e.g. Python. This must be very prone to mistakes and seems like a wrong approach.