How can I make a texture follow the edges of my model?
Blender use “Checker texture” as 3D texture, that is the reason for curvature on non-cubic shapes (like your).

You can imagine 3D texture like a volume of black and white cubes glued together in real world. If you shape this volume into your cylinder shape you get exactly that curvature on surface.

To wrap object by checker texture you should use UV socket in "Texture Coordinates" node (instead Generated). To make it works you have to unwrap your object firts (if it’s not already unwrapped automatically).

In your case try to unwrap existing object by “Cylinder Projection” see tutorial here ...



... or even better by “Follow Active Quad” type. See details in Blender’s Manual how to use it. Don't skip “Note” paragraph that is essential to get correct result (90°grid). Or here - nicely explained





Alternatively

You can start from scratch ... add Cylinder object (that's unwrapped automaticaly). Since you choose UV (in Texture Coordinate node output) you get something like this.



If you go to "UV Editor" blender's layout, switch your object to edit mode and select all vertices. Grid appears in an UV Editor, so you can see how the mesh faces are unwrapped.



Add more loops (Ctrl+R)



Scale them to your shape. Go back to UV Editor and rearrange vertices to get more even grid for texture.