All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
Cheating in exams is prohibited, and it is also forbidden to help others to commit such a sin; Allaah, The Exalted, says (what means): {...And cooperate in righteousness and piety, but do not cooperate in sin and aggression...} [Quran 5:2] Abu Hurayrah narrated that the Prophet said, "He who cheats is not one of my followers." [Muslim]
The fact that this action was done by the teacher or trainer does not make it lawful; he should have been warned about the prohibition of his action and should have been ordered to stop. You should now seek the forgiveness of Allaah, repent to Him, and resolve never to commit this sin again.
Cheating in some exams, although it is forbidden, does not cancel the certificate obtained by the doer nor does it entail deeming it prohibited for him to benefit of it because he has not obtained it entirely through cheating, especially if the person has studied and mastered these subjects and is able to do the job if it is assigned to him because of this certificate.
Shaykh Ibn Baaz was asked:
"A student obtained a college degree and got his certificate through cheating sometimes in exams in the different educational stages, either from notes or from his colleagues, until he obtained his college certificate. After graduation, he was appointed in a job according to his degree for which he received a salary; is this salary lawful or not? Note that he carries out his work duties very well and even works extra hours beyond the working hours. If his earnings are unlawful, then what should be done in this regard? What is your fatwa? May Allaah reward you."
He replied, "He (such person) is obliged to repent to Allaah for what he did and should regret it. As regards his job, it is valid (lawful) and his salary is lawful as long as he is doing what he is entrusted to do, praise be to Allaah. However, it should be noted that he should repent to Allaah of such a misdeed, for repentance erases the sins committed before it."
As for the benefits, if there are certain eligibility conditions required for receiving them and they were met in your case, then there is no harm in availing yourself of these benefits; if these requirements are not met, then it is unlawful for you to receive these benefits while actually being ineligible to receive them.
Allaah knows best.