Let's look at restart first. You need a power OK signal. So you;ll be looking at frequency, value and stability (How long has it been OK). Once it transfers back to the utility, the generator enters a cool down phase and then powers down.
For transfer to generator, you need a power not OK signal, so you do almost the same, but with a warm-up period.
You have to implement testing with or without transfer on some schedule.
Alarms: Oil level, gas level, battery, oil and water temperature, start sequence failed. You have to look at the generator electrically too.