It sounds , to me, it is as though you have two... or more... separate issues.
A flashing "Check Engine Light" means that raw, unburned fuel is escaping the combustion chamber and coming through the Catalyst. NOT GOOD. If the "CEL" continues to flash, shut the car down immediately to avoid further serious damage.
I would bet that your PCM(Primary Control Module) has some current & pending DTC's(Diagnostic Trouble Codes)stored in it.
I would go so far as to say that you may have a P0300-Random Multiple Misfire -and possibly others.
Slipping out of gear could be a few things. Start by ruling simple, inexpensive things out. First safely get under the vehicle to inspect the shifter linkage and external transmission components. Make sure everything is intact and working as it should. -all though from what you're describing, it sounds like an internal Transmission Failure- Pin-point exactly when the problem occurs-exactly. The better you car describe it , the better we can help you. However, from what you are describing, you are sure to eventually need to bring your car in to a specialist.(start looking for a good price on a used Transmission, you may find it cheaper to replace it verses a specialist spending 6 -8 hours disassembling yours at $120 an hour.) -Good Luck.