The seals inside the transmission can get hard over time and miles and when cold, they may not seal well. As the fluid warms up, it makes the seals more pliable and they may start sealing, allowing the transmission to start shifting properly. Outside of rebuilding or replacing the transmission, the only thing I can recommend is a can of Trans X, which you can get at most auto parts stores. The thing is if it does work, you are probably on borrowed time; whether that equates to months or years, I can't tell you.