You can store the password for an encrypted virtual machine in your Mac's Keychain password management system at any time. Mac Keychain remembers the password for you.
You can store the encryption password in the Keychain password management system when you first encrypt a virtual machine. See Encrypt a Virtual Machine. You also have the opportunity to store the encryption password in the Keychain password management system every time you are prompted for the encryption password.