If the MacBook was compromised sufficient to allow an admin password change, erase the Mac snd restore a backup from prior to the breach.
I’d also assume the Apple Account is breached and change that, and enable two-factor authentication if not already in use, and change all other important passwords as those too can be compromised.
As for your question, passwords are not stored anywhere. The cryptographic hashed password values are stored, and not the actual passwords. You’ll need to recall the password or to reset the password.
And given the breach, I’d assume the breach is much wider with existing accounts added or modified, added or reconfigured apps, and whatever other issues or backdoors the perpetrator has added. So I’d erase and restore a backup from prior to the breach, or erase and migrate only files and documents and not apps.