Im trying to think of ditto tactics for my lvl54 ditto in diamond.
Yes it will stay that form until it faints or switched out. Once you use transform, you will stay the pokemon you transformed into or until you switch, then you turn back into regular ditto, and will need to transform again.