I think the format should ideally store the DTM50 values for "50-move counter = 0" separately from the information for positive 50-move counter (either in a separate file or in a separate part of the table). If an engine probes the table during the search of a root position which itself has too many pieces to be in the TBs, the engine will only probe the tables immediately after a capture, so with 50-move counter = 0. The extra information for 50-move counter > 0 is only needed when probing a TB root position, so it is OK if access to this information is relatively slow (e.g. because it is compressed in relatively large blocks that need to be decompressed as a whole).
So for move-counter = 0 a regular format can be used such as the Syzygy DTZ format (I have already used this format for DTM tables).
The signs of the values do not need to be stored since WDL50 is available and should be accessed first. For the same reason draws can be encoded with arbitrary values. A few more tricks are possible. The table should probably be 2-sided (or things may start to get tricky with the 50-move rule and in any event probing during search would be slow).
The next question is how to encode the extra information for 50-move counter > 0.
The DTM50 value for 50-move counter = 0 will be valid for 50-move counter = n up to some value of n. Then it will jump to something higher or to infinity (meaning cursed win/loss), and this may repeat a few times. So these jumps have somehow to be recorded, but the number of jumps may vary from position to position.
It might be acceptable to store information only for one side-to-move.
Not all the "jumps" may have to be stored. For example, if the whole table contains no cursed positions, then the extra information is only relevant if the winning side decides to throw away many moves instead of simply playing the moves that lead to the fastest mate. If the engine that is accessing the tables is winning, there is no reason for that engine to not use the tables and play the fastest mate. If the engine is losing but the opponent is throwing away moves, perhaps the engine should focus on maximizing distance-to-zeroing move rather than distance to mate. But how to decide which of these jumps may be relevant with optimal play by the winning side and which not... needs some thought.
Another question is if cursed wins in the DTM50 (with move-counter = 0) table should be stored as draws (or rather as arbitrary values for best compression, since the WDL50 table will tell us that it is a draw) or whether a useful value could be stored. I guess one could just continue iterating over the DTM50 table during generation to complete it (as Uri suggested) and not store any info in the "extra information" part for these positions. Is it worth it to have some kind of fake DTM values if the DTZ50+ tables already give enough information to steer the game to a win (if the 50-move counter is ignored, or the losing sides plays inaccurately)?