well take into account the simple carbon .
have look at this image
http://upload.wikimedia.org/wikipedia/en/f/f9/BromoethaneSN2reaction-small.pngI'll explain wrt the reaction in the picture first.
The OH- is attacking the C from the back . if it attacks form the front there is no reaction as it can't come near enough to the carbon
now there's transition state and then C-O bond being more strong than the C-Br bond stays and the C-Br breaks.
now instead of the two hydrogens in the given molecule consider them to be carbons and then connected by two other carbons in series .Remove the top methyl grp . draw this by replacing the hydrogens and see just don't draw in the mind , do it on paper.
now on the Carbon nearest to you let there be a methyl substitution cis to Br , Assuming u now the wedge representations . now OCH3- will attack from behind and thus there is inversion of configuration as above thus the incoming OCH3 grp will be trans to the methyl .
see in the transition state , u''ll come to understand better . the Br , methyl are cis and the OCH3 is opposite to Br and thus is trans to methyl .
hope u got it now.
regards
Srihari.