Soo after a lot of research I have found two viable solutions for this.
First one, not really practical but will still work:
For this you will create a cryptomatte in compositing and feather the edges of said cryptomatte with a dilate/erode node and save those images in a dedicated folder via a file output node. If you need the actual outline, use the subtract output from the attached picture, if you want to use it as a mask it's cleaner to use the marked mask output.
You can then import that image(sequence) in the shader editor and connect the texture coordinate output "window" to your vector input in the mapping node. Fun Fact: I found a bug that doesn't allow you to use cryptomattes when using the Blend Mode: Alpha Blend, so make sure to set it to Hashed or Opaque.
The other, and easier method is to use goo engine. This is a custom build optimized for 3d anime in blender. It has a node in the sahder editor called "curvature" that allows you to give objects outline a mask - in realtime without rendering the cryptomatte. To install this follow this reddit post, it sounds daunting but it's a really easy step by step requiring no input other than a few clicks and some copy pasting. You essentially download and install their version of blender. https://www.reddit.com/r/blenderhelp/comments/ywupnw/how_do_i_build_goo_engine/
You can also go to goo engines patreon and buy a built version there for 5€. It will be the same result in the end but the patreon supports their work.
For objects with flat surfaces such as cubes it may be better to use the first method, depends on your needs. Feel free to ask if you need help at any step.