The easiest solution might be to find out if there is an action hook that is fired when a membership is added. wc_memberships_user_membership_saved might work.
The easiest solution might be to find out if there is an action hook that is fired when a membership is added. wc_memberships_user_membership_saved might work.