Using https://phpstan.org/config-reference#multiple-files with PHP files:
includes can also reference PHP files that can be used to define dynamic configurations, see ignore-by-php-version.neon.php and phpstan.neon as examples.
The phpstan.neon.dist should make use of environment variables for the vendor dir for reliably defining scanDirectories entries for CiviCRM Core and dependencies (e.g. other CiviCRM extensions). The included PHP file should be .gitignored and define local values for the environment variables.