This is from the transmission, and it may be from the transmission software needing to be updated or an internal issue. When I address this type of problem, I check for diagnostic codes, check the software version and check the fluid level and condition. I then address any fault codes, update the software and top up or replace the fluid depending on it's condition. After the repairs are done, it's important that the transmission adaptation is set, this helps the computer to adapt to the transmission and make it shift smoothly.
You are going to want to take this to a shop that specializes in Volvos, look here for some in your area: http://repairpal.com/brooklyn-ct-volvo-dealers