Setting up conditional Membership level

Hi, how can I set up a conditional membership level?
I would like to set an S2 membership level which depends on a selection of a field in the registration field.
For example: if a person select “Yes” in registration form field (like Consent), the membership level will set to Level 2 but if selects “No” Level will set to Level1.