Definitely a UFO - Unidentified Flying Object, not necessarily aliens :-).
A few possibilities I can think of (would be nice to know how fast the objects were going, and whether or not they disappeared), arranged by most plausible to least plausible:
Birds If it was just after sunset, or just before sun rise, birds could have been flying up far above, where the sun was shining, though it was dark on the ground. This would be moving fairly slowly through the sky.
Shiny Balloon It could have been a shiny helium balloon drifting by with the lights of the city reflecting off it as it moved, causing the apparent motion. If this were the case, the "dots" should have stayed fairly close together, and it should have been fairly slow moving unless it was low and the wind was blowing fast. It would seem the pattern would be randomized, and not necessarily a "formation" though, unless formation just meant they were travelling together.
Meteor fragments It could have been fragments of a meteor that broke up, but they would likely be travelling straight, and not flying in any recognizable formation (but would be going nearly same direction, likely spreading out with time, and burning up / disappearing). This would have gone fairly fast through the sky and disappeared, or at least shrunk if they were large fragments.
Aliens At first, seemed the only plausible explanation, but there are others after thinking about it a bit.
Satellites would not change formation like that, but there is a possibility atmospheric distortions (like the "waves of heat" you can see coming off the road on a hot day) could have caused the effect with a single passing satellite. However, you probably would have noticed the stars doing the same thing if that were the case. I am also not aware of multiple satellites being grouped together like that, and they would not be able to change formation like that.