Legumes are among the few foods which benefit from the addition of salt at the end of cooking because salt increases the cooking time of legumes.
Ideally you should add salt when the legumes have softened and still have some of their cooking juices, allowing some time for the salt to penetrate them internally.