It is really hard to answer this question because it seems that they were an emergent property of dozens of hobbies that I had (I tend to be seriali hobbyist). Seems like trying to explain how I did learn to ride a bike - I can name few basic skills that are required, but showing which exact part of learning bike riding made it stick is no easy task for me (I remember it as trial and error process and this was the same with my children - they just practiced riding bike and the skills developed thanks to them sticking to the practice). It all looks like a kind of tacit knowledge that can only be developed by pure practice (melodic memory through remembering and playing songs, aesthetics through creating your own compositions, logic through solving problems)
My own story is rather simple - I used to play guitar, a bit of keyboard, sing using karaoke, listening to songs paying full attention and than playing guessing games aking to local tv game called "What melody is this?". At first I was awful at this. But then something changed; I started to notice that I can recall melodic and rhythmic structure of some songs - and this was totally new ability to me (I remember that as a kid I was made fun of by my peers that I could not recognize any songs and my singing voice was wildly out of tune).
One caveat though - It's not like I am any good at music - I estimate that getting to level where others would tell "wow you are good" will take at least another 10 years (and it is not that important because I prefer the journey part, not the destination). But still I know I was a lot worse before forcing myself to learn. And probably if I would get a teacher that would motivate me and give feedback I would get here a lot faster, but as I said - it's the journey, and I really like to learn everything myself.
The message here is that I do not think that most people are unable to learn this kind of skills (those being music, logic or even simple aesthetics). The problem is that most do not have the drive, will or simply the time to stick with practice to overcome their own limitations.