904 acting strange when hot

I think Stroker is right. It sounds like it's time for a rebuild. A worn out trans. will do exactly what you describe. When a clutch pack is worn out it sees it and tries to swap to another gear. This builds heat which thins the fluid causing it to loose even more pressure so the clutches slip more so the problem only gets worse the hotter it gets.