The film is She's the Man (2006).
Amanda Bynes plays Viola Hastings, who disguises herself as her twin brother Sebastian to play on the boys' soccer team at his new boarding school. While impersonating him, she experiences the freedom and opportunities her mother (who gave up soccer for family) never had—a thematic parallel, not a literal body-swap with her mom.