How can I identify a raid boss Pokémon from a regular one in my Pokémon bag?
Assuming your older Magikarp were not caught in raids, you can also tell which one was caught in a raid by the fact that it will have been caught in a Premier ball.
Take two of my Magikarp for example:
The ball used to capture this Magikarp was a Pokéball.
However, the ball used to catch this Magikarp was a Premier ball, which you only are able to use when catching raid Pokémon.
Even if you catch 20 Magikarp and then a raid boss Magikarp in a single day, you'll be able to tell which one was the raid boss by checking what ball was used to capture it.
As discussed in the comments below, this is most useful if you only hang onto one or two Magikarp at a time. If you like to keep a lot of Magikarp on hand (I'm not judging), the easiest way to keep track of which is which might be to just give nicknames to the ones you want to differentiate from the rest.
Click on the "Recent" tab in the Pokémon Bag, and find your new Magikarp. It will be highlighted in light blue (blue aura) and located in the top left. All recent catches are found there.
You can also look at the CP of the boss before capture, and then look for it when scrolling through all of your Magikarp.
The ball of the Pokémon captured in a raid will always be a premier ball, and the Pokéball used can be determined in each Pokémon's stats, as shown in Vemonus' answer.
In addition to the previous answers, a newer way to tell if a Pokémon was caught via a raid is to use the "raid" filter1.
1 This filter will only work for Pokémon caught via raids after ~October 2020. I am not exactly sure how far back this filter goes, but the first Pokémon in this list was caught on 10/11/2020 and Pokémon caught in raids in August 2020 do not show up