Contact whomever told you that they will be terminating your employment in October, who I assume is someone in Human Resources. If it is not someone in Human Resources, then contact the person and cc your Human Resources contact.
A simple email such as the following would get the ball rolling.
Per our communication on SomeDate, I understand my employment is to be
terminated at the end of October. I also understand that this
termination coincides with the relocation of my current department to
NewLocation. I would like to express my desire to stay with the
company, and relocate to NewLocation with my department. Please advise
the possibility of this relocation.
Thank you for your time,
If your notice of termination wasn't from HR, then cc'ing HR on this mail alerts them to the situation.