Custom Module with stage history

Custom Module with stage history

Is there a way to use a custom module to record stage history for the custom module just like how the potentials module does it? I have a custom module that we need to record the date of each milestone / stage change.

How can this be done? Can it be done?