Sir Keir Starmer confirmed plans to place a ‘legal duty’ to consider the needs of military personnel and their families when making policy