if you have engine problem, the check engine light would come on specially for misfires, you mentioned problem happens while shifting from 3rd to 4th so, that answers your question, the problem is within the transmisssion specifically for the parts of 3rd and 4th gears.