If that happened you would know because your lights were on.
And what would actually happen is nothing, because the generator circuit breaker would blow from trying to power the entire neighborhood.
The only way this could happen is if you were right at the end of the feeder line, and managed to down a line such that only you and your neighbor were online - in which case enjoy the free power. (And then yell at your neighbor to fix it.)
Do things properly, sure, but don't over estimate the danger.
Easiest permanent DIY job would be to wire a dedicated outlet to your fridges and freezers and any important electrical equipment, and switch them to the generator outlet when you need it. No crossing circuits, no real problems.
If you have no electrical experience, deal with the extension cords.
Seriously, speaking as someone who has worked as an electrician. Unless you're experienced, don't play with it.