I was in some music classes early on (piano and guitar) and in band from middle school through the end of high school.
If I have perfect/absolute pitch (very doubtful), it's from having certain pitches absolutely burned into my brain. B-flat and F on brass instruments, C on piano, E on guitar, etc.
I can generally memorize and sing back the exact pitches of any song once I've heard it a few times. If I like the song enough, that pitch memory is forever. I will never sing it in the wrong key ever again and that's actually how I get around in music. I can always play back the original song in my head like a tape recording. I learned the names of some chords a long time ago from my favorite songs and now just know them by heart when I hear them (add9, sus4, minor 7th, etc).
Unfortunately, I cannot do this in reverse and name the notes or do any supernatural tricks like Rick Beato's kid. I would have to hum every individual note for a little while and run through the chromatic scale in my mind to tell you the name.
I think to a large extent, it can be trained. I didn't get started until I was like 8 years old and wasn't always the best student either. I hesitate to call this relative pitch because I don't need to hear an outside reference and I can very easily tell when an instrument is out of tune. I'm somewhere in between, and so are most band kids.