You do not need to be a customer to be an affiliate.
THE GENERAL POSITION
Affiliate participation is tied to your Client Area account, not to holding an active service. If you cancel your hosting but keep the account, participation normally continues.
WHAT TO WATCH
If you take commission as account credit and no longer have invoices, the credit sits unused. Consider whether another payout method suits better. Keep your contact details current, since payout notifications go there. Do not close the Client Area account entirely if you want to retain a balance.
CREDIBILITY
Recommending a host you no longer use is harder to do honestly. If you have moved elsewhere, either say so and stop promoting, or be clear in your content that you no longer host here.
Continuing to write "I host all my sites here" after moving is the kind of thing readers discover, and it damages everything else you have written.
IF YOU ARE LEAVING BECAUSE SOMETHING WENT WRONG
Tell us in the cancellation. Some things we can fix, and we would rather know.