The wire you're thinking of, NM or UF, is the wrong stuff. It's far overpriced, and it gives too few amps for its size because of its low thermal rating.
The bad news is, you need 2 cable runs, two 240V breakers, and a UL listed interlock in the panel. The good news is, we can do this thing with sensibly priced aluminum heavy feeder.
If there was a way to "get it done in one", I would tell you, honest. As it is, the dual aluminum run will be way cheaper than one copper run!
If you want to run cable, or use two conduits, #6 aluminum will do, with a #8 aluminum ground. Grounds must be green and neutrals must be white. A proper electrical supply will have these wires or cables.
Call around to different electrical supplies, a few of them are jerks about dealing with the public. Some will want your business though!
This depends on running the wire at 75C thermal rating. Do not use NM type cable and make sure the RV receptacle and generator inlet are rated 75C.
If you want to run one large conduit, you will need six #4 aluminum wires (all black is fine) with a ground of #6 green or #4 black. The reason is the two active circuits in the same conduit force a derate down to 44A for #6Al.
You can declare the generator to be a 44A circuit if its rating is below 44A, but the RV socket must be honest 50A.
Make sure to select an RV outlet, and a generator inlet, which are rated for aluminum wire (they should take #4 wire). Also make sure it is rated 75C if you are using #6 aluminum, because at 60C aluminum is only allowed 40A.
If you want to know which specific types of wire to get (SER vs MH vs XHHW vs USE) then ask another question describing your cable or conduit route. Never use NM (Romex) outdoors.