First step is are you installing a panel with only the circuits you want the gen to power?
If yes, determine the connected load of the circuits within the new panel.
If no, determine the actual 'load' on the 400 amp service.
You can discount some items, ie: the lesser of elec heat or hvac (if installed)
Beside the gen, don't forget the transfer switch.
The above is a 'rule of thumb'.
John


John