Adding a manual transfer switch to handle a portable generator for my house
Yes, you can run just about any length needed between the generator power inlet mounted on the side of your home to the transfer switch.  Of course the wire / cable will need to be sized right for the generator and distance.   Always a good idea to upsize the wiring in case you decided to go with a larger generator later.
Like @Harper-ReinstateMonica said, don't get one of those 6,8,10 xfer switches with the built in power inlet. Get a proper sub-panel with a interlock between the &quot;power from utility&quot; and the &quot;power from generator&quot; breakers.  Then move the desired circuits to the new sub-panel.   This type of panel is called a MTS (Manual Transfer Switch).
There is an other potential option that others here might disagree, depending upon the configuration and brand of your current panel. There are parts you can install on the main panel that created a mechanical interlock between utility power and gen power. There are pros and cons to going that route. Pro is it's a very inexpensive way to provide gen power to the entire home that is code compliant. Down side is you might not be able to free up the breaker space needed and 2) loading issues.  You may have to turn off several heavier loads so as not to overload the generator.
Safest and best practice would be to install the MTS sub-panel and move the desired circuits to it.