Impossible to say for sure. If you think it's the engine, then possibly a sparkplug or injector malfunction that cleared up. If/when it does it again, and if it's safe to pull over, do so. Open the hood and see if it's idling rough as though a cyl is misfiring. If so, disconnect one of the injector connectors and see if it's worse or the same. If worse, does it get better when reconnected (although maybe not fixed)? Do one at a time. If you find one that makes no difference, you've isolated the cyl.