From a remembering the tune perspective, I have the same issues, but I think it's more related to not applying musical lexicon and hearing skills the same way: you remember poetry or a paragraph of text because you remember the ideas and how to go from one to the other, if you are a musician and have something in your head and start thinking along the lines of "this is using a lydian mode, the progression is ii IV V I then it modulates to the relative minor and switches to dorian, also the theme is going down in thirds for two bars, then it will stay on the chord root for one and move to the dominant 7th" you are going to remember it a lot more easily than just by remembering the melody itself
It would be like comparing how easily you can remember poetry in English vs poetry in, say, Russian, where you only have the "sounds of the words" in your head to remember, but you don't have the syntax or the meanings to help you as well.
The first approach has a sense of creative wonder to it, where your being guided by an outsider. As much fun as that is, it is very limiting and I suspect most people abandon that approach as their skill improves.
Writers keep pens and notebooks by their bed so if they wake up in the middle of the night they can start writing right now. Or they have tape recorders. Anything works as long as it's immediately available. The iPhone has a "Music Memos" app, I'm sure there's something similar for Android. That's what I use.
Learning music theory and how to write music properly can come later. As long as you can sing, whistle, or hum a tune, you can record it.
Switching from a DAW to a mostly-hardware setup helped with this, as it's easier to "play" with knobs/sliders/keys/pads than virtual objects accessed via mouse/keyboard. Once you get things wired up, it's pretty straightforward: play around, find something you like, track it in, build more stuff over it.
Ever since making this switch, I found the parts that I used to practice/enjoy (like slicing and manipulating samples, for instance) feel much more tedious.
Another benefit is that it's easier to make mistakes, which often have more interesting results than the thing you originally intended. My guess is because this violates your internal "patterns" and forces you to think outside of your normal "music creation" schema, resulting in a more creative/unique outcome.
I've also tried to switch to "totally live" recording (i.e. minimal sequencing beyond loops and patterns, all automation and non-repeating parts done on the fly), and that's a bit more challenging, because you have to redo everything if you, say, screw up a little solo bit.
That's where music theory pays off. Learning to name chords, scales and arpeggios gives your brain a framework to reason about and remember musical ideas. It allows you to break the music into a more concise abstract representation, rather than holding it in your head as sound. If you understand the structure of music, it's far easier to make connections between different pieces of music.
Do you have much formal knowledge of music theory? If not, that might help.
When you "get a tune in your head", if you can describe it to yourself in abstraction, it will probably be easier to remember (or even just write down).
Check on this page on 12 bar blues for some examples of easy music notations. Similar types of notations and/or terms exist for different parts of a song.
I'm starting to hit its limits for my workflow though. One of the really nice things about how easy it's getting to write software these days is that I can now fire up, say, a Swift playground, and after getting the fiddly basics of "how to record and loop audio buffers" with AudioKit, there are very few limits on what kind of idiosyncratic workflow tool I can design for myself. The UI looks and acts how I want it to, and since over the years I've trained myself to act like a human synthesizer, I can[1] compose a whole song without even worrying about having an instrument nearby.
[0]Loopy - Multitrack audio looping with very simple and expressive control https://itunes.apple.com/us/app/loopy/id300257824?mt=8
[1]The "can" is theoretical. This is my next big hobby project, and I'm still in the fiddly phase.
If I have the beginnings of a song in my head, or I have been humming to myself, sometimes I just record the parts I have as vocals - humming or full-on beatboxing the bass/strings/lead/beats separately and as close as I can make them to my head-song (including filters with my mouth)- and then replace as I go, figuring out how to achieve the sounds that were in my head.
She hates music theory and trying to use her left brain for art. I'll say oh that is in F and she gets mad so, easier to just let her record it than try to notate it down.
You can understand a musical idea as a kind of memory impression, an echo that you can play back in your head, and also as a pattern of pitches and rhythmic structures . Having two reference points , sensory and abstract mathematical is very useful.
The most successful tunes I made were more or less "discovered" from incrementally experimenting in the DAW, and not from any kind of original plan or idea. Maybe I'm just not a musician! (I'm an indie game dev who started making my own tunes for my games)