The Pearson Foundation, the charitable arm of one of the nation’s largest educational publishers, will pay $7.7 million to settle accusations that it repeatedly broke New York State law by assisting in for-profit ventures.