The simple answer is: you don't.
For a transaction to be validated you need to send it over the network. And this needs electricity and connection.
Agreed. Even if your mobile phone is battery charged, you may not be able to connect to the internet (network) so you can't. Therefore it is still good practice to keep some cash with you, so in times of disaster and you need basic commodities, you can easily buy if stores and stocks are available.