It sounds as if you have a situation where an electrical connection, (likely a battery ground wire or main fuse connection) is physically expanding and an air gap is opening up or a connection is weakening greatly under "heat soak" conditions.
Heat soak is what happens when the engine compartment temperature RISES shortly after shutting the engine off, due to the engine no longer being cooled by water circulating through the radiator.
I would first check the fuses by taking each out and then replacing it a couple times-which burnishes the connection, then check the battery connections and grounding wire.
If that doesn't work go somewhere where they will do the engine scan for trouble codes -many auto parts store will do it for free.