First things first: capturing an amp's sound through the PA will always be an approximation of the original, but with the right know-how, you can get pretty darn close.
Traditionally, the approach involves using a guitar speaker (be it from a combo or a cabinet) miked up. For decades, the Shure SM 57 has been the go-to choice, although nowadays, there's a bunch of mics that could transmit the signal in a more "neutral" and "professional" manner. It seems like this classic microphone emphasizes those guitar-specific frequencies, and people have just gotten used to that sound. Sure, there are guitarists who put fancy studio mics in front of their amps (like Brian May—seen in his tutorial video), but many others, even those not worried about costs, still prefer the relatively cheap SM 57. That's how the legendary "brown sound" of early Van Halen records was captured with this very mic.
Mic placement is a true art. Directly facing the speaker's membrane from the front creates a really sharp, treble-heavy tone. Positioning the mic at the edge results in a more "muffled" sound. For most applications, finding the sweet spot in between is key: aiming the mic—often experimented with at various angles—towards the edge of the cone. A few centimeters can make a world of difference. An amp with a lack of midrange will sound different from a warmer, more mid-focused one, so there's no one-size-fits-all approach.
Once you've found the right position for your amp-mic combo, remembering it can be quite tedious, which leads to another option:
In recent years, high-quality frequency-corrected direct outputs (DI) have almost become standard in good modern amps. The reason for needing frequency correction lies in the fact that guitar speakers don't deliver an objective frequency spectrum. Most of the action happens in the mids; too much bass or treble ruins the sound, and your 2000 Euro Mesa-Boogie ends up sounding like a shaver. Sure, some might argue that a well-placed mic gives a more natural result, but honestly, does that even cut through the overall live sound during hectic gigs? However, guitarists without DI-equipped amps need not despair. These outputs are available to buy separately, not expensive, nor do they take up much space. A prime example is the legendary Red Box by Hughes & Kettner.