OEM installation and image Ubuntu 18.04

You can boot the Ubuntu installer in OEM mode to achieve the result you are after.

When you boot the installation media, hit SHIFT to get to the installation menu, then hit F4 and select ‘OEM Install’.
When Ubuntu has finished booting install the system as usual, you will be prompted for a temporary username and password.

When installation has finished, boot the system and log on with the temporary username and password you created earlier, you can now make any other alterations to the system that you want, for example installing extra software. When you’re all done just double-click on the ‘Prepare for shipping to end user’ icon on the desktop and then shut down the machine, it’s now time to take your image of the drive.

Next time the machine is booted the user will be asked to set up their account.