We know that a cotangent bundle $T^\star M$ has a canonical symplectic form and $M$ is a nature Lagrangian submanifold of it. A well known result is that any submanifold $X=\{(p,f(p)): p\in M\}$, where $f$ is a closed one form is Lagrangian. Denote by $[f]$ the Hodge homology group of $f$. Assume that we flow  $X$ in a Hamiltonian direction to $Y$, then $Y$ will be a Lagrangian submanifold of $T^\star M$. My question is can we write it as $Y={(p,g(p)): p\in M}$ for some closed one form $g$.? If so, do we have $ [g]=[f]?$ Thanks in advance!
Edit: I edit the question according to Serge's comments.