Example 5 In $\triangle ABC$, $AB = BC > AC$, $AH$ and $AM$ are the altitude and median from vertex $A$ to side $BC$, respectively. Given that $\frac{S_{\triangle MH}}{S_{\triangle ABC}} = \frac{3}{8}$. Determine the value of $\cos \angle BAC$. ${ }^{[5]}$
(2009, Beijing High School Mathematics Competition Preliminary (Grade 10))