We’re actually storing them in the user’s Roaming Settings on your mailbox as a map from thread-id to the task-ids.
We investigated storing them as custom properties on the message objects, but those are for each individual message and the API as we understand it doesn’t allow you to save them at the level of a thread. This meant that we got different results depending on which message in a thread was focused, and we think most users would prefer to have tasks associated with the whole thread.
Could you give us some more details about your use case? It would be an interesting feature to allow you to search for threads associated with an email.