That wouldn't be an enforceable contract. Contacts require some consideration on both sides to be legally valid. However if the training is provided by a third party then the employer may be able to pay for it as a forgivable loan with the balance being written off if the employee stays for a couple years.