How to record Intercom / ATC in a small aircraft like a Piper Archer?
For the GoPro specifically there are audio recording cables you can buy which connect to your intercom jack and provide a pass-thru connection for your headset.
There are other cable options available to support recording on different devices (e.g. iPhone/Android phones and tablets).

As is often the case with "aviation" accessories these can be somewhat expensive, but they're also pretty reliable drop-in solutions. As mah noted if you have a spare headset jack you're not using plugging into that can be much cheaper and just as effective.