Let us say the volume increases by the system doing work. In that case, temperature will drop. Because of the zeroeth law, energy has to come from somewhere. We need energy not only to do the work but also to increase the sepration between the molecules of gas. This energy has to come from the kinetic energy of the molecules. Hence temperature will drop.
But the scenario requires that temperature remain steady. Then, how do we increase the volume of the gas. Where will the energy required come from? It has to be provided externally, by pulling on the piston.Slowly. So that temperature remains steady. Now, once the volume is increased, where did the energy used to pull the cylinder go? It cannot go to the kinetic energy of the molecules because temperature is constant. As per the zeroeth law, it cannot disappear. Thus, it will turn up as increase in potential energy of the molecules.