How does this ring expansion on a steroid system occur?
It is clear that the first step is ozonolysis with a slightly reductive workup, yielding two ketones. You seem to have already established that. The second step features a base and an alcohol as a solvent. The hydroxide can react with the ketones in two ways: 1) nucleophilic attack at the electrophilic carbonyl carbon 2) abstraction of the mildly acidic $\alpha$ hydrogen. With the methanol in large excess as the solvent, it could also potentially act as a nucleophile to attack the carbonyl group to eventually form hemiacetals. However, what seems to be the most preferred reaction pathway, based on thermodynamics, here is the aldol condensation to form the $\alpha$,$\beta$-unsaturated ketone. I will now go through the considerations that a problem solver could have made.

Why is the aldol condensation thermodynamically favoured over the other alternative reation pathways?

The key reason is that the formation of the conjugated enone $\pi$ system is quite energetically favoured. On the mechanism of the aldol condensation, Carey &amp; Sundberg (2007) wrote the following, on  p. 684: 


  In general, the reactions in the addition phase of both the base- and acid-catalyzed
  mechanisms are reversible. The equilibrium constant for addition is usually unfavorable
  for ketones. The equilibrium constant for the dehydration phase is usually favorable
  because of the conjugated $\alpha$,$\beta$-unsaturated carbonyl system that is formed. When the reaction conditions are sufficiently vigorous to cause dehydration, the overall
  reaction can go to completion, even if the equilibrium constant for the addition step is
  unfavorable.


What about the ketone-hemiacetal equilibrium?

The addition products (i.e. hemiacetals) formed between methanol and the ketones in the basic medium can easily be converted back to the reactants (i.e. reaction is highly reversible). The depletion of the ketone by it reacting in the aldol condensation pathway thus pushes the equilibrium towards the ketone form. However, this consideration is not even important in this case since the equilibrium constant for the ketone-hemiacetal equilibrium is much less than one. 

There are numerous $\alpha$ hydrogens but which one would be removed?

To answer this question, usually we would have to know if the conditions provide thermodynamic or kinetic control. Not much information has been provided in this case so I believe it is reasonable to assume thermodynamic control since only one product would clearly dominate while there are various possible kinetic products. 

In this case, the hydrogen is first abstracted from the terminal methyl group of the newly-formed ketone, forming the enolate ion. This then acts as a nucleophile attacking the carbonyl carbon of the other newly-formed ketone. Upon protonation, the $\beta$-hydroxyketone is formed. Finally, there is E1cB elimination to form the product, as shown in B. 

Other addition products may result either from 1) formation of other enolates from abstracting other acidic $\alpha$ hydrogens or 2) formation of other possible addition products from the enolate attacking other carbonyls (possibly even those on other molecules). Firstly, many of the alternatives would result in ring sizes that would possess too much strain. In this case, a 4-membered ring could form if deprotonation took place at the other $\alpha$ carbon of the same ketone. Intermolecular reaction would not be as favoured here since the proximity of the groups simply make the intramolecular reaction "hard to resist". 

Conclusion

I have just gone through some important considerations behind arriving at the structure B, as well as the mechanism of the aldol reaction. Many details provided may seem extraneous though... Hopefully, you are able to understand how the "ring expansion" took place now. 

References

Carey, F. A., &amp; Sundberg, R. J. (2007). Advanced Organic Chemistry Part A. Structure and Mechanisms (5th ed.). Springer.