For anyone who needs this, you can accomplish it as follows:
version: '3.9'
services:
mysql:
# ...
volumes: # Persistent data
- persistent_vol:/var/lib/mysql
volumes:
persistent_vol:
name: ${MYSQL_PERSISTENT_VOLUME:-default-volume-name}
driver: local