Any “electric guitar sound” is a combination of three things:
- frequency response in the guitar itself, PUs etc.
- shaping through the amp circuitry
- speaker/cabinet response
The third point is often underestimated, but it actually has a very significant contribution: the cabinet has a highly uneven response that drastically influences the sound. In particular, guitar amps aren't equipped with HiFi multi-way speakers, but use just one single speaker type: a woofer, i.e. actually a low/mid speaker. That may seem kind of weird, as electric guitar is perhaps most stereotypically known for screamingly-bright, high-pitched sounds. This screaming brightness comes from either pickups with a strong resonance in the high-mid range (best known in the “Tele twang”) or from the hard clipping flanks you get when distorting the signal, as of course guitarists like to do a lot. Those effects are so strong that more often than not, the speaker cutoff is required for the final result to sound actually palpable. Your amp's USB output however evidently does not use a microphone to record what comes out of the speaker, but splits off the signal before it – thus you don't get that smoothening there.
Fortunately, cabinet response can nowadays be simulated very well digitally. For that you need a convolution plugin and a suitable impulse response file. You will easily found such on the internet.
The alternative is to pick up your actual own amp with a microphone, as was traditionally done. That gives you more freedom of experimenting with mic positions yourself, but I doubt you will get a better result this way than you can with professionally recorded IR files. If you want to give it a shot, again, the internet is stuffed with recommendation how to mic a guitar cabinet. It's much easier than micing up drums, and doesn't require too fancy microphones. Of course you may find that small Yamaha amp can't be a match to the big sound of a 4×12" cabinets, but you may also be surprised how well such a small speaker can sound on a recording.