So far as education is concerned, schools already address consent, etc in PSE lessons in Scotland and I'm assuming that it's also addressed in other parts of the UK.
These lessons might have a positive effect on most boys, but they'll not affect the mindset of a determined sex offender. I've encountered those both in my own life and in my former teaching posts.
In 40 yrs of teaching and in 66 yrs of life any actual sex offender that I've encountered has been white British. I can think of one probable future sex offender who was not.
The problem I've found is that even when staff members flag up worrying patterns of behaviour, nothing is done about it - indeed, I was mocked when I reported very concerning behaviour on the part of a white Scottish teenager. He is now incarcerated.
Setting all that aside, I do believe that if an offender is not a British national then he should serve his sentence in this country and then be returned to his country of origin.
There are very few countries that would allow a British offender to avoid deportation after serving their sentence. Off the top of my head, I can think of at least one Scottish murderer who served his sentence in the U.S. and was subsequently deported to the United Kingdom.
I can't find the case that I was thinking of - it happened pre-internet. However, I've come across this case of a Scot who was deported from Canada after serving his sentence for murder:
https://www.heraldscotland.com/news/12158590.deported-scots-born-killer-held-on-assault-charge/