Welcome.
Good luck e/ your boat.
The problem as-described doesn't make sense.
The hydraulic rams will lift or lower the drive on-command.
If the linkage was broken, then forward thrust at 3,000 rpm would push the drive down, against the transom, not up out of the water.
IMO, the only way for the drive to lift out of the water during forward propulsion is for the hydraulic rams to lift, for the pump to be active causing the hydraulic to lift.
FYI, the hydraulic outdrive lift is different than the trim tab hydraulic actuator.
My suggestion is to examine the wiring, switch, from the power source to the hydraulic pump. Look for degradation. Wiggle and tap on the parts while the circuit is powered to determine if the fault can be reproduced.
For the rewiring project. Use only marine-grade wires of sufficient gauge throughout the boat. Marine wire has individually tinned conductor strands and has appropriate insulation rating and resistance. Even though the cost is higher, I like Ancor brand.
Use marine-grade terminals of appropriate size. Use a high-quality ratcheting double crimp tool. For the larger battery cables I like the TMB6 tool w/ appropriate dies.
Follow the marine color code. Create an accurate wiring diagram. Label both ends of every conductor, I like my Brady printer on heat shrink or self-laminating cable labels. Follow ABYC throughout. Use chafe protection, like split loom or raceways. Support the wiring every foot, w/ cushioned stainless Adel clamps or nylon wire ties w/ anchor holes.
Use only marine fuses, circuit breakers, switches and lights.
Feel free to ask questions as you go.
https://samerwebapp01apncus01.blob.core.windows.net/mmgw-env-a/filer_public_thumbnails/filer_public/99/a3/99a38bd1-11a4-4873-b131-836a43cdd292/alpha-drive.jpg__1000x750_q85_autocrop_size_canvas_subsampling-2_upscale.jpg
http://www.sterndrive.info/sitebuildercontent/sitebuilderpictures/Mercruiser-Alpha-1-Gen-2-Trim-Cylinder-Parts.jpg