ESA is a separate entity to the EU.

(When the UK left the EU it was able to remain in ESA because of this separation.)