You need to create a persistent set, e.g.
default persistent.seen_endings = set()
and then you will add to that set when you reach a relevant part in the game (that's this part:)
$ persistent.seen_endings.add("end1")
and in order to record that progress for an achievement, you can set the progress to the length of the list e.g.
$ ending_achievement.progress(len(persistent.seen_endings))
Sets are used because they can't have duplicates, so the length of the list will be the number of unique endings the player has seen, and it won't matter if they go through the same ending multiple times/it won't count them more than once towards the achievement.