There are a million ways it could be implemented, I didn't mean to suggest that's the only one.
For a more Mac-like method, make it a special Finder mode where instead of showing the directory contents, installer DMGs display a big icon of the app with an Install button under it.
If you really want to get at the files directly, right clicking in the DMG could give a "Show disk image contents" item similar to how app packages are handled. Right clicking on the big application icon would include an "Open" item to circumvent installation and execute from the disk image.
For a more Mac-like method, make it a special Finder mode where instead of showing the directory contents, installer DMGs display a big icon of the app with an Install button under it.
If you really want to get at the files directly, right clicking in the DMG could give a "Show disk image contents" item similar to how app packages are handled. Right clicking on the big application icon would include an "Open" item to circumvent installation and execute from the disk image.