You already answered the question by yourself: chroot is how you run stuff inside another installation, and this includes package manager commands.
Pacman does have its own option to work on an alternative root: (-r
), e.g. pacman -Qr <dir>
, but it's not fundamentally different.
The easiest approach is to ls /mnt/var/lib/pacman/local
. Each installed package's metadata is stored as a separate directory;directory which is named after that package; cut off the last two fields to get just the package namepkgname.
Pacman does not distinguish AUR packages from other types of packages. Once it's installed, it's always a "local" package whether it came from a repo or from your own makepkg.