When a dito transforms it literally turns into the opposing Pokemon. It also gets all the moves know by the target. This is only temporary. The dito will remain like this until the battle is over. A normal type dito. So to answer your question ditto will turn into a ghost type if it copies a Pokemon of that type. Same goes to other types
I hope this helped!!!