Like in the first episode of the Ward cartoon (where Peabody calls on his “friends” like the President to vouch for him to legally adopt Sherman) he goes through the courts and does indeed fully adopt Sherman. A judge slams a gavel and gives him legal standing as a guardian and everything.