I can’t think of a way to change the admin password in Recovery because you have to be in System Preferences -> Users & Groups to do that. However, if its a matter of forgetting your admin password in the existing system, in the usual login screen, if you type in the wrong password several times, you will get a prompt towards the bottom to the effect that you can use your Apple ID to log in, meaning your Apple account ID (e-mail and Apple ID password, not your Mac password).
I recall seeing this in the newer versions of macOS, but I’m not sure if the same will happen with the pre-Mojave versions. It has been too long since I ran one of those systems that I don’t remember if the feature was available then.
If the difficulty is because the startup does not complete successfully (i.e., hangs before you can log in), you might want to try Safe Mode. On startup, as soon as you see the Apple logo come up, hold down the Shift key until you get to the login screen. A safe boot will take longer—usually much longer—than a regular boot, so give it more time than usual. You would think that it would take less time because extensions and startup items don’t load in Safe Mode, but a great deal of software and hardware tests take place in the background during the process.