The info @psherman shared is great for a standard installation where additional packages are added manually after.
For the case of adding packages with image builder or auc/asu etc, the script in this post works. It also works for the first case of standard install with manual additions. There may be a couple packages/modules that differ though. Read the other posts in that thread for more details on it.