You might do a cylinder balance test, when the problem is ongoing. You usually kill the cylinders one at a time, quickly, by killing spark, Pay attention to the rpms, if you kill a cylinder that has no effect on the rpms, that cylinder is either dead or very weak, then you check fuel--spark and compression on that cylinder.

Any applicable trouble codes? You can check mil codes, yourself. Use a gage and check fuel pressure, when problem is ongoing. You could have a vacuum leak that only shows up after it is warm.