Very slowly and probably not at all
Any evolution of the kind you suggest would have to happen over a long period of time. In reality, it's really unlikely that this could ever happen.
But since this isn't Biology SE, let's come up with a plausible way it theoretically could happen. You could have an aquatic create evolve an air bladder to control its buoyancy. Then imagine an evolutionary pressure to be as light as possible. Either food is just above the surface of the water or predators are on the prowl. Now imagine that this creature has a symbiotic relationship with a form of algae that produces hydrogen gas (which really exist). Over time, evolutionary pressures select for the creatures that rise the highest, eventually driving the winning creatures clear out of the water. As they gradually rose higher and higher, they'd have to evolve to breath dry air. And they would also need some way of controlling their movements in air, unless they use their tentacles to pull themselves along. They'd also have to have a really big air sack. Even with the lifting power of hydrogen, you'd need something like 100 cubic feet of the stuff to lift a 7-pound creature.