How a species of marine mammals became capable of interstellar travel is not clear. There is little actual information on this subject, most of which varies from source to source. The whale spotted in Beyond Good and Evil is classified as Megaptera anaerobia, implying that breathing is no longer required for survival, which would be a key evolutionary advantage. The Liir of Sword of the Stars are actually psychic dolphins, which attain whale-like appearance after many years. Adding to the confusion is the existence of flying whales, for example, the arcwhales in Skies of Arcadia.
Additionally, whale-like designs in spaceships (and airships) are not uncommon. One of the earliest and most popular examples is the Lunar Whale of Final Fantasy IV, which transported players to the moon. Another example is the eponymous spaceship in Whale's Voyage.