Muscle does not contain any components which allow it to have a memory. Only the brain and the spinal cord (the Central Nervous System) has such an ability.
What the term is actually taken to refer to is more likely the process of ‘adaptive plasticity’; where remolding of neural circuits occurs, as a result of activity. The more you do the activity, the stronger the adaptation. A neat way to describe this process, which I took from E. Paul Zehr, is “neurons that fire together, wire together”.
Once the activity becomes automated (where the movement comes under the control of the brains’ cerebellum), it will degrade over time unless the activity is refreshed; “use it, or lose it!” The refreshment process however can be brief, provided correct initial and repeated programming of the activity was made early on through conscious repetition. At this stage, the activity no longer requires much conscious attention to the movement and the activity can be adapted easily to different environments.
Don’t train the muscle, train the activity!