There is a kit available that wires into your main panel, and has an "inlet" -to activate that you have to slide a switch over that cuts off the main breaker in the panel, preventing you from backfeeding the grid. You then plug the cable into your generator. You can manually control which circuits are fed by turning breakers on or off. You could do the same thing with a subpanel, sure, at added expense.
Like this:

https://www.amazon.com/GenSafety-Generator-Breaker-Panel-Interlock/dp/B09RGP1QR3/ref=asc_df_B09RGP1QR3/?tag=hyprod-20&linkCode=df0&hvadid=563702687488&hvpos=&hvnetw=g&hvrand=4231858892423159635&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9008352&hvtargid=pla-1642387760306&psc=1
They're available for most panels. You do need space for the inlet circuit breaker.