If able you can connect shore power wires to the panel feed wires inside the transfer switch case using some WT 54 Ideal wire nuts or equivalent. These will take several Number 6 wires.
I carry a set of these in case my transfer switch breaks. As others have mentioned make sure you cut back burnt or discoloured wire to clean copper.
Depending on what is wrong with the switch you might just need new lugs if they can be replaced. Possibly a whole new contactor.
Make sure you unplug the trailer and generator if equipped is disabled with starting cable disconnected and turn the breaker off too
https://idealind.com/content/dam/electrical/support/wire-connector-catalog.pdf Page 8
Brian