Here's one way: https://answers.microsoft.com/en-us/windows/forum/all/installing-windows-to-an-external-drive-literally/c5f46404-acfa-4a9e-845e-39b4a1889553
Another would be installing the external drive internally first, installing it, then shut down before the first boot (before it enters the OOBE), then pulling the drive out and put it back into it's external enclosure.
Another would be to use DISM to apply the install.wim image onto an external drive.
Please read up on how to use DISM and how WIM images work. It'll give you a better understanding of how windows installation and imaging work so you can manipulate it in very interesting ways.