Okay, nevermind I solved it
I found this issue and apparently, you can simply pass a path where it searches for definitions in the VS Code settings for Intelephense.
So I linked it to my local nextcloud git repository, by adding those two paths. Maybe more will be needed, I will experiment a bit with this.
/Applications/MAMP/htdocs/nextcloud-server/core
/Applications/MAMP/htdocs/nextcloud-server/lib