How do we setup a power generator to automatically power up in case of a blackout?

You should contact an Electrician for that.