Crankshaft position sensor is a common cause when they get warm. The new one must have a spacer on the end to properly set the air gap or that too can cause intermittent stalling. New sensors use either a thick paper spacer stuck to the end, or they will have a thin plastic rib molded to the end. If you reinstall a used sensor with the rib, you are to cut the remaining part of the rib off and use a new paper spacer.
To verify the stalling is related to these sensors, while it still won't restart, measure the voltage on the small wire feeding the ignition coil or any injector. I think it's dark green / orange. You should see 12 volts there for just one second when you turn on the ignition switch, but what's important is that voltage must come back during engine cranking.