If it's marked the crank then you mean it's coming off the big chainring.
("Cog" is usually taken to refer to the ones at the back.)
To amplify Tynan, if you look straight down on the fron derailleur you'll probably see two small screws sitting side by side. These limit how far the derailleur can move from side to side. Put the chain on the smaller chainring then, using whatever kind of screwdriver or allen key it needs, tighten - clockwise - the screw which is further out from the seat post two full turns. This will prevent the derailleur cage from moving so far when you shift up and puching the chain past the outer chainring.
Two turns might be too much: maybe now the cage won't move far enough to push the chain up onto the big ring, or maybe it will shift ok but the chain will rub against the inside of the front cage when it's heading for a small cog (high gear) at the back.
In these cases, back off the limit screw a little.
Fiddle around a bit and you'll soon get it right.