Stowe provides further details about her story based on actual events in A Key to Uncle Tom’s Cabin.
In A Key to Uncle Tom’s Cabin, Stowe discusses what it is to be with Legree: (Legree is introduced not for the sake of vilifying masters as a class, but for the sake of bringing to the minds of honourable Southern men, who are masters, a very important feature in the system of slavery, upon which, perhaps, they have never reflected. It is this: that no Southern law requires any test of CHARACTER from the man to whom the absolute power of master is granted.) She also makes the point that all bad masters are not necessarily as bad as Legree, as well as all good masters are not as good as St. Clare. (pg. 68)
The full story of both connections can be read in Chapter 10, “Legree” of A Key to Uncle Tom’s Cabin.