The key thing is interlock. There is a secondary issue that GFCI does not play well with reverse power. If you use the subpanel then there are a number of possible problems - I can explain in detail if needed.
I think the easiest solution is to either put the inlet at the location of the subpanel or, if the former hot tub location where you want to put the inlet is a significant distance away, use the subpanel box simply as a place to splice the wires.
You definitely need an interlock in the main panel between the main breaker and the generator inlet breaker, which will likely mean rearranging breakers as interlocks generally only work in one specific position in a panel. An interlock is usually just two specially sized/shaped pieces of metal, designed so that it surrounds access to either the main breaker and a branch double breaker below it or a pair of branch double breakers (for a panel using a backfed breaker instead of a "main breaker") so that one piece slides to block either one or the other breaker - i.e., so that you can't have both ON at the same time.