Membership plugin

I need to know how to say

if ( user is member(basic) ) {

do this

} else {

do that

}

What does the membership plugin uses to:

1) determine what plan a user falls under?

2) know if a user membership is expired?