How can I extend the wires inside a transfer panel?
If it's inside the box, they CAN be spliced. But. You need splices that are up to the job, and depending on the type of splice you can get, you may also need a hydraulic crimper to set them. This might be a part of this job you'd be better off farming out to an electrician with the right tools and experience - a bad splice on a 200 amp cable can be all kinds of trouble you don't want. If the cable is aluminum, the range of bad things that can happen just increases.

If you are talking about a section of cable that runs between the boxes, the better approach is to grit your teeth and buy one long enough. If this is one of those "move the service entrance to put in a transfer panel that the generator can never really light up anyway" deals, splicing may be the only option, but it still is inferior to unbroken cable, IME. In theory, if done right, it should be fine - in practice, sometimes you get a failure years later that you would not have had if there wasn't a splice.