You boot the system into WinPE and run the capture from there.
Why do this at all though? The current common path for Windows 10 is to deploy the base media (that has been serviced to include the latest CU) and they layer on all changes and customizations after the base image is deployed. This is a far better experience for all involved and requires far less tinkering and time. Building images, in general, should be considered a dead and left-over path from the dark-ages of Windows deployment and provisioning.