Is it possible to force a specific program to remain in memory after closing it?
MacOS's memory management is quite sophisticated, and it generally does try to keep as much stuff in memory as possible. If Alfred is still running, then it will be in memory. 

If you have quit Alfred, then it might still be retained in memory, which is why it is faster to load next time. However, the OS will clear the quit app from memory, if the memory is needed for something else. So you might experience slowness somewhere else if you don't let the OS clear the quit app.

Recommendations for improving speed:


Leave Alfred running all the time. If it's slow to come to foreground sometimes, even when its been running in the background, then that's not a memory issue, but something else: possibly related the slowness of the HDD.
Get more RAM, if possible. You don't say what model of Mac and how much RAM.
Replace the HDD with an SSD.