I'm playing the guitar for years, MANY years, there's nothing wrong with my ears, I can hear and understand individual notes, I can even identify them without a reference tone BUT ... I can't remember music to save my life. I can remember everything as long as I can identify what I'm listening to because I translate it to words in my head instead of sounds. Like if I hear a melody and I manage to identify the notes, then it's fine, I know the melody... Things change when it comes to chords. I will listen to a chord and forget what I heard as soon as it stops ringing. This is way too limiting for a musician so I wonder if there would be a way to improve it.
Since you say that you can memorize lines fairly well, you could try rewriting chord progressions as multiple lines. This is helpful anyways because voice-leading is a big part of harmonic progressions in both classical and jazz. Though this might be a challenge if the chord voices don't lend themselves to being individual voices, i.e. because of the melodic intervals and crossing of lines.
You can also try to find different songs with similar/same chord progressions and try to notice the similarities in feel and mood.
Like you can’t remember a melody as the sum of their notes but by its shape and quality! you have to recognize and memorize short chord progressions.
The whole is more than the sum of its elements! (Gestalt-theory).
Try to begin with the cadences:
C - G7 - C
C - F - C
C F G C
C F C G C
G F C
listen to the Blues schema!
Learn to listen and identify the chord progressions with secondary dominants:
C D G C
C A D G C
C E A D G C (circle of fifths)
the same with V7 chords.
By analyzing songs by their chord functions (major, minor, 7, dim. and aug. and memorizing entire parts, sections, songs you will train your ear and recognize whole passages and chord progressions, sequences of fifth falls and augmenting sequences.
If you play Guitar concentrate your ear also to the 1st string or the bass line. (Voicing!) Try to sing along this lines - and the tune of course. Also play the chords as arpeggios very slowly and sing the chord tones, naming them and mind which tones are repeated or doubled.
Analogues practice on the Piano.
I write training software for musicians and based on my experience I believe that virtually every kind of musical skill can be developed by any person, provided they figure out the the right exercise for it, and practice it.
In your case, the "right exercise" might be something like this:
First of all, to better understand the concept of this exercise, think of those EKG machines, or those lie-detectors, where you have an unfolding roll of paper and a needle that leaves a mark on it...
Now, in that context, imagine that when the needle is at the bottom it means that your aural memory is completely empty, and when it is at the top it means it's full, i.e. you have a vivid mental impression of a particular chord.
Now, guitar in hand, and with this (imaginary) machine in front of you, play a chord, with a single strum, for one second. While that chord is playing the needle will go all the way to the top, and when it stops playing, the needle will move toward the bottom (i.e. you forget it).
Now the exercise is this:
Play a chord and stop it after one/two seconds.
Try to keep that sound ringing in your own mind, but without tryingtoo hard. Rather, simply "observe" how the impression of that chord fluctuates up and down a little, while fading.
When the needle hits zero and stays at zero for a few seconds, play the chord again, like before, for a second or two.
Again observe the impression of the chord in your mind, see if now it stays for a longer or shorter time than before, etc. (Every time it will be a little different of course)
Again when the impression gets to zero and doesn't come back up for a few seconds, play the chord again.
Repeat the above process a few times with the same chord. Next time, use a different chord. Don't spend a lot of time on this, a couple of minutes each time are enough, but see if you can do this a few times a day.
I believe that if you do something like this, up to a few times a day for several days, your aural memory for chords will definitely wake up and develop some muscle of its own, so to speak. Best wishes!
My armchair psychology view on this.
You have to transform the passive third-person observation question to an active first-person one. Instead of simply perceiving as an outsider, your question has to be "what would I have to do to create that harmony in that situation." Can you play melodies by ear? Can you accompany the melodies with chords by ear? If you cannot accompany melodies with chords by ear, that's why you cannot remember chords. The "what chord is this" identification question is meaningless to you, because your success does not depend on it. You have to put yourself in a situation where you have to get it right or otherwise you're creating bad harmony and the whole music is totally bad, you ruined the fun for everyone, and it was your fault. FAIL! But if you do get it right, then you just made beautiful music, big success, pleasure and reward and personal gratification. SUCCESS!
So: start accompanying melodies with chords by ear. Find any suitable chords that support the melody comfortably. Or find the exact chords that are on a particular recording. Practice every day. Start with easier songs with fewer chords, progress to more diverse ones. Imagine being on a gig and having to get it right.