Stochastic Free Energies, Conditional Probability and Legendre Transform for Ensemble Change