You can pass UBUNTU_STORE_AUTH_DATA_FILENAME="..."
to ubuntu-image
when creating an Ubuntu Core Image.
See this post for the technical detail and this doc for exporting your credential. You can also check snapcraft export-login --help
to limit the usage of your exported credential.