Circuit for power on switch and self power-off ESP8266?
This is a good resource about the Power on / Power off circuits for uC. I think what you need is described in section: "Latching push button ON/OFF power switch using a MOSFET high side switch"