The 'check engine' light is designed to come on when the computer detects a problem in the engine or transmission. When a problem is detected, a trouble code is stored in the computer; which can be retrieved with an instrument called a scan tool. The code will tell you what the problem is that it detected. So it sounds like there is a problem in the 4 wheel drive system or transmission.
You'll need to have the computer scanned for codes to find out what the problem is. Some auto parts store will do free scans; so phone local parts stores to see if there is one in your area that offers that service. And, after the problem is fixed, the light will not go off until the code is cleared from the computer with a scanner.