COS approved from Oct

I work for Employer X on L1.
I got L1 to H1 COS approval from Employer Y from Oct 1st.
My questions are -

  1. How soon should I resign and inform Employer X to withdraw L1 ?
  2. If I am in the notice period (Employer X) after Oct 1st will that be illegal ?