Scotland will be the first country in the world to ensure its education system recognises the issues faced by the LGBTI community, ministers have announced.