2000 f250 power stroke

i have a 2000 f250 power stroke with a manual transmision and 130,000 miles. about 1 1/2 yrs ago my i was shifting from 3rd to 4th and the check engine light came on and the whole truck just went into nuetral [engine still running] for about 5 sec and the light went off and i was back driving before i could even get stopped. about 2min later it did it again and it was fine for about 3 months. it seems to do it every three or four months now and it has never stranded me but now it seems to be happening more frequently. last week it happened 5 times on fri 2 times sat and a few more monday. it always is in between shifts. never while in gear and never down shifting. if i am pulling a load and shift at a higher rpm it seems to do it more. if anyone has any insight it would be greatly appreciated. thanks.