Yes, if genuine anonymisation is feasible; however, technical testing is essential and your contracts may provide otherwise. In most cases, a contract update + transparency is the cleanest path.
Mind one step that is easy to skip: the act of anonymising is itself a processing operation, so it needs its own lawful basis and a purpose-compatibility check before the identifiers come off. Do that assessment — and confirm your contracts permit the re-use — and anonymised training data becomes a clean, durable foundation rather than a later liability.
Shall we apply this matter to your situation?
Tell us your specific situation in a few sentences; we'll assess it with the right team.