Example 5 If the three sides of $\triangle A B C$ are consecutive integers, and the largest angle $\angle B$ is twice the smallest angle $\angle A$, find the lengths of the three sides of the triangle.
(IMO - 10 problem)