There is no official answer, because it is not a feature offered by macOS's Installer. Most packages are digitally signed; if problems are found, the signing organisation can be contacted and held responsible.
Files created or modified by scripts within a package are not tracked. macOS's
installer does not record or monitor the true impact of the package on the destination.
You may be looking for a File Alteration Monitor.
FSEvents and kqueue
For macOS computer wide file system change notifications, see FSEvents.
fs_usage reports system calls and page faults related to filesystem activity in real-time:
sudo fs_usage -f filesys
See 10.4: Monitor file system events in real time:
OS X 10.4 has a private API that's used by Spotlight to monitor file system events such as file creation, renaming, and permission changes. Several command line and GUI tools are now available that can suscribe to the event notification system and provide a log of the events. These are useful for, e.g., monitoring files created by installers, and so forth.
FSEvents on macOS are implemented using BSD's kqueue:
Kqueue not only handles file descriptor events but is also used for various other notifications such as file modification monitoring, signals, asynchronous I/O events (AIO), child process state change monitoring, and timers which support nanosecond resolution, furthermore kqueue provides a way to use user-defined events in addition to the ones provided by the kernel.