Flavor structure of $Λ$ baryons from lattice QCD: From strange to charm quarks