driving fine go into passing gear the check engine light comes on and the engine dies. Stop engine starts right back up and runs until you go into passing gear and it dies. check codes the only one was for secondairy air supply HELP

I have maybe wrote this up I'll try again.
I can drive the car with no problems or lights, under hard acceleration( going into passing gear) the car will down shift the ckeck engine light will come on and then the engine dies. I stop on the side of the road turn off the key then restart the car the ckeck engine light will still be on but the car performs as normal, until you step on it again then the same thing happens it dies. The only code shows secondary air supply.
If anyone can help I would appreciate it.