One problem many guitarist struggle with is their memory. They play a great set of chords, but cannot remember which chords they played. Or they play an awesome melody and forget what they did. This is very unfortunate because all those ideas should not go to waste. You could use those ideas to write songs or keep them in your repertoire to try them out in a jam session.
What is the cause of this problem?
There are a wide range of problems that could be occurring. Most probable is that you are just not used to remembering sequences. I’m not fond of the brain-as-a-muscle analogy but in one sense this fits the situation: You will get better at remembering passages of music by doing it regularly.
In addition to doing it frequently here are some guidelines to make this as fast as possible. Let’s assume you are playing chord progressions and you want to remember one specific progression. The best thing you can do is to describe the emotions each chord is evoking. Once you have described the chords in this way it’s easier to memorize the sequence of emotions. This helps because emotions are easier for our brain to remember than certain guitar chords. It can get even easier if you tie the sequence of emotions together by a short story.
A great and fun way to master your memory for melodies is to play a phrase over a backing track, wait for one measure and then play it again. This can get complicated really quickly so I suggest to start with short phrases of three to five notes and expand after this works consistently. After doing that for some time you could also do little call and response phrases on your guitar where you change the end of your phrase when you play it the second time.
If you are able to transcribe there is also the brute force method to avoid losing the chord progressions or melodies that you improvise: Record yourself the whole time while improvising. This way none of you ideas get lost while you master your memory.
Investing time into making your memory better is an investment that will help you in nearly all areas of life. Because of that regular training in this and similar manner is highly recommended. Have fun!