could be any number of things TBH..
Best bet is to get the codes read off the ECU and see if there are any errors recorded and go from there.
Most likely a faulty or dying sensor IMO..
does the engine light come on at all ? if it does then there will be a code to read off the ECU.