To travel through time to save the whales the crew of the original enterprise use a klingon ship on a slingshot approch to pass warp 10 and travel through time. The ship was really only capable of TNG scale warp seven so how can a gravity slingshot which could at most accelerate you up one C allow for an increase in 3 warp factors?
It's been awhile since I've seen st 6 so I may be getting it a little off
In reality, or even in Star Trek physics, it almost certainly can't. But Star Trek has always been willing to sacrifice some of the "science" of the show for the purposes of drama - something I'm personally fine with as long as they don't break it too hard.
For instance, in the TNG finale All Good Things..., in the future timeline, Dr. Crusher, who is a captain by then, orders he helm to do warp 13 or something. They most likely found a way to break the warp 10 barrier (remember the Enterprise-D could almost go warp 10 already), and realized you don't actually go through time when you reach that speed - something that can be corroborated by a few other instances - for instance in Voyager episode The Voyager Conspiracy, Mr. Tash uses a catapult that makes a ship go much faster than warp 10 if the story in that episode is to be believed - but there's no evidence or mention of any time distortion, distillation, or anything else.
Instances of time travel in Star Trek, across the series outside of this movie, all use some other method of causing a ship to travel through other than speed. A ship going fast enough to go in the past (or future) basically never occurs.
So I think the most likely explanation is that it makes zero sense, but you gotta do something to get them back in time; the Federation inventing a time machine is going to cause innumerable problems if you ever do Star Trek again at any point past this movie - "Why doesn't the Federation just use their time machines" - and having someone just show up with a time machine so Kirk can go to the past also doesn't make a whole lot of sense on its own, although they might have been able to come up with something clever there.