Forever is custom.
No, they can keep the title “the honorable”, but they are no longer a Secretary once they leave office, so they aren’t supposed to use the title (unless you want to call them “former Secretary”). Nobody ever refers to Kissinger as “Secretary Kissinger”, for example, he is just “Henry Kissinger”, “Mr. Kissinger”, etc.
Hillary just decided she would keep using it and nobody called her out on it.