XPS Foam and Plywood behind main electrical panel?
Most people install their electrical panel in an unfinished part of their basement and don't worry about insulating it.

However, if you are sure the panel will not have to be moved then you can mount it however you like and not have to worry about moving it later.

I would install an oversized piece of foam and plywood to allow for additions later. If you have the room that is.

Good luck!