Have you checked the fluid level in the trim system? Sounds like it's very low on fluid as it pumps so much and stops while the motor keeps running as it can't build more pressure. Check to see that it is fully filled. If not, fill it and cycle up and down while checking for any leaks throughout the hydraulic lines as it must have leaked somewhere. The hydraulic fluid doesn't vanish or burn away so I'd say there is a leak in the system somewhere if it is low. Unless you find the leak, it will work for a while and then you'll run into the same thing as the level gradually drops and you'll find when trying to trim up it will stop at lower and lower angles of trim.Google "changing fluid on yamaha outboard power trim" and you'll find lots of info and videos how to check and do it.